package com.qdu.servlet;

import com.qdu.dao.GetBookInfoByKey;
import java.io.IOException;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@WebServlet("/sbs")
public class SearchBookServlet extends HttpServlet {

    GetBookInfoByKey GetBookInfoByKey=new GetBookInfoByKey();
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //1.获取请求参数
        String key=req.getParameter("key");
        //2.执行业务逻辑
        List list=GetBookInfoByKey.getBookInfoByKey(key);
        //3.生成相应结果
        req.setAttribute("List", list);
        req.getRequestDispatcher("/search.jsp").forward(req, resp);
        
    }
}